package com.ruoyi.user.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.user.mapper.userMapper;
import com.ruoyi.user.domain.User;
import com.ruoyi.user.service.IuserService;

/**
 * 用户Service业务层处理
 *
 * @author pengjie
 * @date 2023-12-18
 */
@Service
public class UserServiceImpl implements IuserService
{
    @Autowired
    private userMapper userMapper;

    /**
     * 查询用户
     *
     * @param id 用户主键
     * @return 用户
     */
    @Override
    public User selectsysuserById(String id)
    {
        return userMapper.selectsysuserById(id);
    }

    /**
     * 查询用户列表
     *
     * @param user 用户
     * @return 用户
     */
    @Override
    public List<User> selectsysuserList(User user)
    {
        return userMapper.selectsysuserList(user);
    }

    /**
     * 新增用户
     *
     * @param user 用户
     * @return 结果
     */
    @Override
    public int insertsysuser(User user)
    {
        user.setCreateTime(DateUtils.getNowDate());
        return userMapper.insertsysuser(user);
    }

    /**
     * 修改用户
     *
     * @param user 用户
     * @return 结果
     */
    @Override
    public int updatesysuser(User user)
    {
        user.setUpdateTime(DateUtils.getNowDate());
        return userMapper.updatesysuser(user);
    }

    /**
     * 批量删除用户
     *
     * @param ids 需要删除的用户主键
     * @return 结果
     */
    @Override
    public int deletesysuserByIds(String[] ids)
    {
        return userMapper.deletesysuserByIds(ids);
    }

    /**
     * 删除用户信息
     *
     * @param id 用户主键
     * @return 结果
     */
    @Override
    public int deletesysuserById(String id)
    {
        return userMapper.deletesysuserById(id);
    }
}
